﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeBehind="Instruments.aspx.cs" Inherits="SEP.Admin.Instruments" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphTitle" runat="server">
    Instruments
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphBody" runat="server">    
<asp:ScriptManager ID="scriptmananger1" runat="server" />
    <asp:LinkButton ID="btnNewInstrument" Text="Create an instrument" runat="server" OnClick="btnNewInstrument_Click" />
    <br />
    <br />
    <asp:GridView ID="grvInstruments" runat="server" AutoGenerateColumns="False" EmptyDataText="No instruments at this time.">
        <Columns><asp:TemplateField HeaderText="Instrument type">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "INSTRUMENTTYPE.DESCRIPTION") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Manufacturer">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "MANUFACTURERTYPE.DESCRIPTION") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Model" DataField="MODEL" />
        </Columns>
    </asp:GridView>    
    <%--start instrument modal--%>
    <ajt:ModalPopupExtender ID="modalNewInstrument" runat="server" CancelControlID="btnInstrumentCancel"
        TargetControlID="btnNewInstrument" PopupControlID="pnlNewInstrument" PopupDragHandleControlID="PopupHeader"
        Drag="true" BehaviorID="ShowInstrumentModal" BackgroundCssClass="modalBackground">
    </ajt:ModalPopupExtender>
    <asp:Panel ID="pnlNewInstrument" runat="server">
        <div id="modalInstrument">
            <div class="modal">
                <table width="300" border="0">
                    <tr>
                        <td align="center" colspan="2">
                            <p>Create an instrument</p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="lblInstrumentError" runat="server" CssClass="errorLabel" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Type:
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlInstrumentType" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Manufacturer:
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlManufacturerType" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            Model:
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtModel" runat="server" MaxLength="1000" Columns="11" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <asp:Button ID="btnInstrumentCancel" runat="server" Text="Cancel" />
                        </td>
                        <td align="right">
                            <asp:Button ID="btnInstrumentSubmit" runat="server" Text="Create" CausesValidation="false"
                                OnClick="btnInstrumentSubmit_Click" OnClientClick="showInstrumentModal();" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </asp:Panel>
    <%--end instrument modal--%>
</asp:Content>
